package com.hh.bss.auth.filter;

import static com.hh.bss.util.extjs.JsonHelper.outJson;


import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.hh.bss.auth.client.OnlineManager;
import com.hh.bss.config.Environment;

public class PreviewFilter extends HttpServlet implements Filter  {

	
	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain filterChain) throws IOException, ServletException {
		// TODO Auto-generated method stub
		HttpServletRequest req = (HttpServletRequest)request;
		
		HttpServletResponse resp = (HttpServletResponse)response;
		
		req.setCharacterEncoding("gb2312");
		resp.setCharacterEncoding("gb2312");
		resp.setContentType("text/html;charset=gb2312");
		filterChain.doFilter(req, resp);
		//response.setContentType("text/html;charset=gb2312");
		
	}

	public void init(FilterConfig arg0) throws ServletException {
		// TODO Auto-generated method stub
		
	}
	

}
